﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class viewcardsent : System.Web.UI.Page
{
    private bussiness bus;
    string id;
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (Request.QueryString["id"] != null)
        //{
            id = Request.QueryString["id"];

            bus = new bussiness();
            LogSentMail lsm = bus.getLogSentMailById(Convert.ToInt32(id));
            lblReceiver.Text = lsm.NameReceived;
            lbltitle.Text = lsm.Title;
            lblmessage.Text = lsm.Messages;
            lblSender.Text = lsm.NameSender;
            lblSignature.Text = lsm.Signatures;
            Ecard ecard = bus.getEcardById(lsm.EcardId);
            List<Ecard> lstEcard_display = new List<Ecard>();
            lstEcard_display.Add(ecard);
            //Repeater1.DataSource = lstEcard_display;
            //Repeater1.DataBind();
            Repeater3.DataSource = lstEcard_display;
            Repeater3.DataBind();
            load_EcardThank();


        //}
        //else
        //{
        //    Response.Redirect("error.aspx");
        //}



    }
    private void load_EcardThank()
    {
        bus = new bussiness();
        Repeater2.DataSource = bus.getTop8EcardThankYou();
        Repeater2.DataBind();
    }


}
